<!DOCTYPE html>
<html layout:decorate="~{layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">

<head>
    <meta content="IE=edge" http-equiv="X-UA-Compatible"/>
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"/>
    <title th:text="#{cas.mfa.duologin.pagetitle}">Duo Login View</title>
    <script th:src="@{/js/duo/Duo-Web-v2.min.js}"></script>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main class="container mt-3 mb-3" role="main">
    <div class="m-auto w-lg-66" layout:fragment="content">
        <form id="duo_form" method="post" th:action="@{/login}" th:object="${credential}">
            <div class="alert alert-danger alert-dismissible fade show" id="msg" role="alert"
                 th:if="${#fields.hasErrors('*')}">
                <span th:each="err : ${#fields.errors('*')}" th:utext="${err + ' '}">this error block and text is only shown if there are errors</span>
            </div>

            <input name="execution" th:value="${flowExecutionKey}" type="hidden"/>
            <input name="_eventId" type="hidden" value="submit"/>
            <input name="geolocation" type="hidden"/>

            <div class="m-0 p-0" id="login">
                <iframe class="mdc-elevation--z1"
                        data-post-argument="signedDuoResponse"
                        frameborder="0"
                        id="duo_iframe"
                        th:attr="data-host=${apiHost},data-sig-request=${sigRequest}">
                </iframe>
            </div>
        </form>
    </div>
</main>
</body>
</html>